package com.gotokeep.gyromousedemo

import android.app.Application
import android.content.Context
import kotlin.math.PI

open class AppContext : Application() {

    override fun onCreate() {
        super.onCreate()
        appContext = this
        screenWidth = resources.displayMetrics.widthPixels
        screenHeight = resources.displayMetrics.heightPixels
    }

    companion object {

        lateinit var appContext: Context
        var screenWidth: Int = 0
        var screenHeight: Int = 0

        const val DIVIDER = ","
        const val SERVER_IP = "10.2.72.48"
        const val PORT = 8010

        /**
         * 垂直方向的弧度范围，对称分布，比如 [-PI/2, PI/2]
         */
        const val VERTICAL_RAD_RANGE = PI * 0.3

        /**
         * 水平方向的弧度范围，对称分布，比如 [-PI/2, PI/2]
         */
        const val HORIZONTAL_RAD_RANGE = PI * 0.3
    }
}
